:root {
  --primary: #3498db;
  --secondary: #2c3e50;
  --success: #2ecc71;
  --warning: #f39c12;
  --danger: #e74c3c;
  --light: #ecf0f1;
  --dark: #2c3e50;
  --gray: #95a5a6;
  --border: #ddd;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.app-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.app-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.app-header p {
  font-size: 1.1rem;
  margin-bottom: 20px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.features {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
}

.feature {
  background: rgba(255,255,255,0.2);
  padding: 15px 25px;
  border-radius: 8px;
  min-width: 150px;
}

.feature span {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.main-content {
  display: flex;
  gap: 30px;
}

.input-section {
  flex: 1;
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.result-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.result-display {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
}

.result-display h3 {
  color: var(--secondary);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

.result-content {
  max-height: 300px;
  overflow-y: auto;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 20px;
  line-height: 1.8;
}

.result-content p {
  margin-bottom: 10px;
}

.input-summary {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
}

.input-summary h4 {
  margin-bottom: 10px;
  color: var(--dark);
}

.api-tabs {
  margin-top: 20px;
}

.tab-buttons {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.tab-buttons button {
  padding: 12px 25px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
  transition: all 0.3s ease;
  position: relative;
}

.tab-buttons button.active {
  color: var(--primary);
}

.tab-buttons button.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
}

.matrix-section, .vector-section {
  margin-bottom: 25px;
  border: 1px solid var(--border);
  padding: 15px;
  border-radius: 8px;
  background: #fafafa;
}

.matrix-section h3 {
  margin-bottom: 15px;
  color: var(--dark);
}

.matrix-input table {
  width: 100%;
  border-collapse: collapse;
}

.matrix-input th, .matrix-input td {
  border: 1px solid var(--border);
  padding: 10px;
  text-align: center;
}

.matrix-input input {
  width: 60px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
}

.vector-input {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
}

.vector-item {
  display: flex;
  align-items: center;
}

.vector-item span {
  margin-right: 10px;
  font-weight: 500;
}

.vector-item input {
  width: 60px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.process-input {
  margin-bottom: 20px;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.process-card {
  padding: 15px;
  background: var(--light);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.process-card.selected {
  background: var(--primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.config-controls {
  display: flex;
  gap: 25px;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--light);
  border-radius: 8px;
}

.config-controls label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.config-controls input {
  padding: 10px;
  width: 70px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

button {
  padding: 12px 25px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

button:hover {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

button:disabled {
  background: var(--gray);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.history-list {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-height: 400px;
  overflow-y: auto;
}

.history-list h3 {
  color: var(--secondary);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

.history-list ul {
  list-style: none;
}

.history-list li {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.history-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.history-type {
  font-weight: 600;
  color: var(--primary);
}

.history-time {
  color: var(--gray);
  font-size: 0.9rem;
}

.history-preview {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
  color: var(--dark);
  line-height: 1.6;
}

.empty {
  text-align: center;
  color: var(--gray);
  padding: 40px;
}

.error {
  background: #fff0f0;
  border-left: 4px solid var(--danger);
}

/* 响应式设计 */
@media (max-width: 900px) {
  .main-content {
    flex-direction: column;
  }

  .features {
    flex-direction: column;
    gap: 15px;
  }

  .feature {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  .app-header h1 {
    font-size: 2rem;
  }

  .config-controls {
    flex-direction: column;
    gap: 15px;
  }

  .vector-input {
    grid-template-columns: 1fr;
  }
}